// pages/check/property/property.js
Page({

	/**
	 * 页面的初始数据
	 */
	data: {
		startTime: "",
		pg: 1,
		endTime: '',
		data: []
	},

	/**
	 * 生命周期函数--监听页面加载
	 */
	onLoad: function(options) {
		wx.getStorage({
			key: 'uid',
			success: (e) => {
				console.log(e)
				this.setData({
					uid: e.data.uid
				})
				this.sure()
			}
		})

	},
	sure() {
		let a = this.data.data
		wx.request({
			url: getApp().globalData.http1 + 'action=getCapital&uid=' + this.data.uid + '&startTime=' + this.data.startTime +
				'&endTime=' +
				this.data.endTime + '&pg=' + this.data.pg,
			success: (e) => {
				console.log(e)
				let pd = 1
				if (e.data.data.length < 15) {
					pd = 0
				}
				e.data.data.capital.forEach(function(item, index) {
					a.push(item)
				})
				this.setData({
					data:e.data.data,
					list: a,
					pd: pd
				})
			}
		})
	},
	ovo() {
		if (this.data.pd == 1) {
			this.setData({
				pg: this.data.pg + 1
			})
			this.sure()
		}
	},
})
